From 37623ba6964acf573e100903fbdd1453d69d2e26 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 28 Sep 2023 15:13:55 +0100 Subject: Add Patio code gen for struct field accesses --- ...mpiler.testing.snapshots.Snapshotter)].expected | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineStructTests]/[method:canGenerateCodeForDefineStruct(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineStructTests]/[method:canGenerateCodeForDefineStruct(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected') diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineStructTests]/[method:canGenerateCodeForDefineStruct(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineStructTests]/[method:canGenerateCodeForDefineStruct(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..c7b77936 --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineStructTests]/[method:canGenerateCodeForDefineStruct(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,49 @@ +Compilation unit elements: + +( + function + "shed__function__User__0" + visibility=private + locals=((param "closurePointer__0" data-ptr) (param "local__isActive" int) (param "local__name" int) (val "structValuePointer__0" data-ptr) (val "structValue__0" int)) + return-type=int + body=( + (alloc-heap (local "structValuePointer__0") (struct (int int))) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct (int int)) + offset=(0) + value=(local "local__name") + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct (int int)) + offset=(1) + value=(local "local__isActive") + ) + (data-ptr-to-int (local "structValue__0") (local "structValuePointer__0")) + (return (local "structValue__0")) + ) +) + +Locals: + * (val "structType__User__0" int) + * (val "closurePointer__User__0" data-ptr) + +Instructions: + +( + (alloc-heap (local "closurePointer__User__0") (struct (function-ptr (struct ())))) + ( + memory-store + pointer=(local "closurePointer__User__0") + layout=(struct (function-ptr (struct ()))) + offset=(0) + value=(function-ptr "shed__function__User__0") + ) + (data-ptr-to-int (local "structType__User__0") (local "closurePointer__User__0")) +) + +Temporary stack: + * structType__User__0 -- cgit v1.2.3